package handlers

import (
	"net/http"

	"gitee.com/anxu/golang-web/src/repository"
)

type Home struct {
	hander
}

func (this *Home) Index(w http.ResponseWriter, r *http.Request) {

	var files []string

	if user := this.user(); user == nil {
		files = []string{"layout", "navbar", "index"}
	} else {
		files = []string{"layout", "auth.navbar", "index"}
	}

	this.render(w, repository.Thread.FindAll(), files...)
}
